import { request } from "../../request/index.js";
//Page Object
Page({
  data: {
    swiperList:[],
    cateList:[],
    floorList:[],
  },
  //options(Object)
  onLoad: function(options) {
    // wx.request({
    //   url: 'https://api-hmugo-web.itheima.net/api/public/v1/home/swiperdata',
    //   success: (result) => {
    //     this.setData({
    //       swiperList:result.data.message
    //     })
    //   }
    // });
    this.getSwiperList();
    this.getCateList();
    this.getFloorList();
  },
  // 获取轮播图数据
  getSwiperList(){
    request({url:"/home/swiperdata"})
    .then(result=>{
      this.setData({
        swiperList:result.data.message
      })
    })
  },
  // 导航
    getCateList(){
    request({url:"/home/catitems"})
    .then(result=>{
      this.setData({
        cateList:result.data.message
      })
    })
  },
    // 楼层数据
    getFloorList(){
      request({url:"/home/floordata"})
      .then(result=>{
        this.setData({
          floorList:result.data.message
        })
      })
    }
});
  